package com.vrv.netmgr.entry;

import com.vrv.netmgr.R;
import com.vrv.netmgr.persistent.LoginSharedPreferencesHelper;
import com.vrv.netmgr.vo.LoginInfo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;

/**
 * 描述：显示关于功能页面
 * @author Administrator
 */
public class SystemSettingFun extends Activity {
	//
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.system_setting_aboutfun);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.common_title);
		getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
		//设置标题
		setTitle();
	}
	/**
	 * 描述：页面恢复时调用
	 */
	public void onResume(){
		super.onResume();
		LoginInfo loginInfo = LoginSharedPreferencesHelper.getLoginInfo(getApplicationContext());
		if(loginInfo.isFullScreen()){
			getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		}else{
			getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
		}
	}
	/**
	 * 描述：设置标题内容
	 */
	public void setTitle(){
		//
		TextView title = (TextView) findViewById(R.id.title_text);
		title.setText("功能介绍");
		// 初始化返回按钮
		ImageButton backBtn = (ImageButton) findViewById(R.id.backBtn);
		backBtn.setVisibility(View.VISIBLE);
		backBtn.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				onBackPressed();
			}
		});
	}
	@Override
	public void onBackPressed() {
		finish();
		overridePendingTransition(R.anim.push_right_out, R.anim.push_right_in);
		super.onBackPressed();
	}
}
